unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, frxClass, StdCtrls, frxDesgn;

type
  TForm1 = class(TForm)
    frxUserDataSet1: TfrxUserDataSet;
    frxUserDataSet2: TfrxUserDataSet;
    frxReport1: TfrxReport;
    Button1: TButton;
    frxDesigner1: TfrxDesigner;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure frxUserDataSet1GetValue(const VarName: String;
      var Value: Variant);
    procedure frxUserDataSet2GetValue(const VarName: String;
      var Value: Variant);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  frxUserDataSet1.RangeEnd:=reCount;
  frxUserDataSet1.RangeEndCount:=10;

  frxUserDataSet2.RangeEnd:=reCount;
  frxUserDataSet2.RangeEndCount:=20;

  frxReport1.LoadFromFile('00001.fr3');
  frxReport1.ShowReport();
end;

procedure TForm1.frxUserDataSet1GetValue(const VarName: String;
  var Value: Variant);
begin
  if VarName='Field1' then Value:=Format('value1-%D',[frxUserDataSet1.RecNo]);
  if VarName='Field2' then Value:=Format('value2-%D',[frxUserDataSet1.RecNo]);
end;

procedure TForm1.frxUserDataSet2GetValue(const VarName: String;
  var Value: Variant);
begin
  if VarName='Field1' then Value:=Format('value1------------------%D',[frxUserDataSet2.RecNo]);
  if VarName='Field2' then Value:=Format('value2------------------%D',[frxUserDataSet2.RecNo]);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  frxReport1.LoadFromFile('00001.fr3');
  frxReport1.DesignReport();
end;

end.
